							********************************************************************************
							********************************************************************************
								
									*                 GEOPOLITICS AND DEMOCRACY                  *   
									* 				    Trubowitz and Burgoon  			         *
									*															 *
									*          Replication codes for Tables and Figures          *
									*               in main text and appendices A-F 			 *
									*															 *

							********************************************************************************
							********************************************************************************
								
								

*******************
*******************

* MAIN TEXT FIGURES
*Basis-code (final formatting edited in-Figure) *

*******************
*******************

*******************
* Chapter 2 Figures
*******************	


*Figure 2.1
use "qog_std_ts_finalmini.dta"
sc kofpoleconDJg lwdiexpmil if lwdiexpmil<3.7, msize(vsmall) || sc kofpoleconDJg7075 lwdiexpmil7075 if corewest!=1&year==1975, ml(ccodealp)  msize(vsmall) mlabsize(vsmall) || sc kofpoleconDJg7075 lwdiexpmil7075 if corewest==1&year==1975, ml(cname2)  mlabsize(medsmall) mcolor(red) ytitle("Partnership: KOF-based index of policies") xtitle("Power: Military expenditures as share GDP (logged values)") title("Partnership and Power, 1950-1975")   legend(label(1 "Indiv. country-years") label( 2 "Non-Core West mean") label( 3 "Core West mean"))


*Figure 2.2
use "qog_std_ts_finalmini.dta"
sc kofpoleconDJg lwdiexpmil if lwdiexpmil<3.7, msize(vsmall) || sc kofpoleconDJg7691 lwdiexpmil7691 if corewest!=1&year==1989, ml(ccodealp)  msize(vsmall) mlabsize(vsmall) || sc kofpoleconDJg7691 lwdiexpmil7691 if corewest==1&year==1989, ml(cname2)  mlabsize(medsmall) mcolor(red) ytitle("Partnership: KOF-based index of policies") xtitle("Power: Military expenditures as share GDP (logged values)") title("Partnership and Power, 1976-1991")   legend(label(1 "Indiv. country-years") label( 2 "Non-Core West mean") label( 3 "Core West mean"))


*Figure 2.3
use "qog_std_ts_finalmini.dta"
sc kofpoleconDJg lwdiexpmil if lwdiexpmil<3.7, msize(vsmall) || sc kofpoleconDJg9217 lwdiexpmil9217 if corewest!=1&year==2000, ml(ccodealp)  msize(vsmall) mlabsize(vsmall) || sc kofpoleconDJg9217 lwdiexpmil9217 if corewest==1&year==2000, ml(cname2)  mlabsize(medsmall) mcolor(red) ytitle("Partnership: KOF-based index of policies") xtitle("Power: Military expenditures as share GDP (logged values)") title("Partnership and Power, 1992-2017")   legend(label(1 "Indiv. country-years") label( 2 "Non-Core West mean") label( 3 "Core West mean"))


*Figure 2.4
use "qog_std_ts_finalmini.dta"
sc kofpoleconDJgEU15 wdiexpmilEU15 , ml(year2) lw(medthick) connect(l) lpattern(solid) msize(vsmall) mlabsize(vsmall)  || sc kofpoleconDJg wdi_expmil if cname2=="United States"&wdi_expmil<8, ml(year2) connect(l)  lpattern(solid)  msize(vsmall) mlabsize(half_tiny) lcolor(gs11)  || sc kofpoleconDJg wdi_expmil if cname2=="Japan", ml(year2) connect(l) lpattern(solid)  msize(vsmall) mlabsize(half_tiny)  lcolor(dkorange)  ytitle("Partnership: KOF-based index of policies") xtitle("Power: Military spending (% GDP)")


*Figure 2.5
use "TBpopcntryyearcpds2c-replic.dta"
gr box lkofpoleconDJg2 if year2>1969&year2<2020&corewest==1, over(year2) noout
gr box kofpoleconDJg if year2>1969&year2<2020&corewest==1, over(year2) noout


*Figure 2.6
use "TBpopcntryyearcpds2c-replic.dta"
sc lnetpartnervwghtraeel3cy5075  linetpromilvwghtraeel3cy5075 if icountryb==61&year2==1970 || sc lnetpartnervwghtraeel3cy7691 linetpromilvwghtraeel3cy7691  if icountryb==61&year2==1980 || sc lnetpartnervwghtraeel3cy5075  linetpromilvwghtraeel3cy5075 if icountryb==71&year2==1970 || sc lnetpartnervwghtraeel3cy7691 linetpromilvwghtraeel3cy7691  if icountryb==71&year2==1980 || sc  lnetpartnervwghtraeel3eu155075 linetpromilvwghtraeel3eu155075 if year2==1970&icountryb==51 || sc    lnetpartnervwghtraeel3eu157691 linetpromilvwghtraeel3eu157691 if year2==1985&icountryb==51 || sc lnetpartnervwghtraeel3 linetpromilvwghtraeel3 if icountryb==61&year2>1991, ml(year2) connect(l) || sc lnetpartnervwghtraeel3 linetpromilvwghtraeel3 if icountryb==71&year2>1991, ml(year2) connect(l) ||  sc lnetpartnervwghtraeel3EU15yr linetpromilvwghtraeel3EU15yr if icountryb==51&year2>1991, ml(year2) connect(l)


*Figure 2.7
use "TBpopcntryyearcpds2c-replic.dta"
*Figure 2.7a (Left-hand panel)
gr twoway line kofpoleconDJgcorewestyear year2 if year2>1969&corewest==1,  sort(year2) yaxis(2)  ytitle("Partnership policy: KOF-based index of policies", axis(2)) ||  line lnetpartnervoteweightcwestyr year2 if year2>1969, sort(year2) yaxis(1)  ytitle("Partnership in Policies: KOF-based index of policies") ytitle("Manifesto index of voter support for partnership", axis(1)) title("International Partnership")
*Figure 2.7b (Right-hand panel)
gr twoway line wdi_expmil2corewestyear year2 if year2>1969&corewest==1,  sort(year2) yaxis(2)  ytitle("Power policy: Military spending (%GDP)", axis(2)) ||  line linetpromilvotewghtcorewestyear year2 if year2>1969, sort(year2) yaxis(1)  ytitle("Power in Policies: Military spending (%GDP)") ytitle("Manifesto index of voter support for power", axis(1)) title("Power")


*Figure 2.8
use "TBpopcntryyearcpds2c-replic.dta"
*Figure 2.8a (EU partnership)
gr twoway line kofpoleconDJgEU15 year2 if year2>1969&year2<2019&icountryb==41, ytitle("KOF-based index of government support") ||  line lnetpartnervotewghteu15yr year2 if year2>1969&year2<2019&icountryb==41, yaxis(2) ytitle("Manifesto-based index of voter support", axis(2)) title("EU-15 Support for Partnership")
*Figure 2.8b (EU power)
gr twoway line wdiexpmil2eu15yr year2 if year2>1969&year2<2019&icountryb==41, ytitle("Military spending as a share of GDP (%)") ||  line linetpromilvoteweighteu year2 if year2>1969&year2<2019&icountryb==41, yaxis(2) ytitle("Manifesto-based index of voter support", axis(2)) title("EU-15 Support for Power")
*Figure 2.8c (US partnership)
gr twoway line kofpoleconDJg year2 if year2>1969&year2<2019&icountryb==61, ytitle("KOF-based index of government support") ||  line lnetpartnervoteweight year2 if year2>1969&year2<2019&icountryb==61, yaxis(2) ytitle("Manifesto-based index of voter support", axis(2)) title("U.S. Support for Partnership") legend(off)
*Figure 2.8d (US power)
gr twoway line wdi_expmil2 year2 if year2>1969&year2<2019&icountryb==61, ytitle("Military spending as a share of GDP (%)") ||  line linetpromilvoteweight year2 if year2>1969&year2<2019&icountryb==61, yaxis(2) ytitle("Manifesto-based index of voter support", axis(2)) title("U.S. Support for Power")
*Figure 2.8e (Japan partnership)
gr twoway line kofpoleconDJg year2 if year2>1969&year2<2019&icountryb==71, ytitle("KOF-based index of government support") ||  line lnetpartnervoteweight year2 if year2>1969&year2<2019&icountryb==71, yaxis(2) ytitle("Manifesto-based index of voter support", axis(2)) title("Japanese Support for Partnership") legend(off)
*Figure 2.8f (Japan power)
gr twoway line wdi_expmil2 year2 if year2>1969&year2<2017&icountryb==71, ytitle("Military spending as a share of GDP (%)") ||  line linetpromilvoteweight year2 if year2>1969&year2<2019&icountryb==71, yaxis(2) ytitle("Manifesto-based index of voter support", axis(2)) title("Japanese Support for Power")


*******************
* Chapter 3 Figures
*******************	

use "TBpopcntryyearcpds2c-replic.dta"
*Figure 3.1
sc stdpartpow4ma5 sstran if corewest==1&year2==2015&stdpartpow4ma5>-1.5&sstran>6, ytitle("Support for liberal internationalism" "(partnership + power)") xtitle("Social security transfers (% GDP)")|| lfitci stdpartpow4ma5 sstran if corewest==1&year2==2015&stdpartpow4ma5>-1.5&sstran>6,  ciplot(rline) legend(off)
*
sc stdpartpow4b sstran if corewest==1&year2==2015, ytitle("Support for liberal internationalism" "(partnership + power)") xtitle("Social security transfers (% GDP)")|| lfitci stdpartpow4b sstran if corewest==1&year2==2015,  ciplot(rline) legend(off)
*
sc fstdpartpow4b sstran if corewest==1&year2==2016, ytitle("Support for liberal internationalism" "(partnership + power)") xtitle("Social security transfers (% GDP)")|| lfitci fstdpartpow4b sstran if corewest==1&year2==2016,  ciplot(rline) legend(off)


*Figure 3.2
use "TBpopcntryyearcpds2c-replic.dta"
*Figure 3.2a (Left-hand panel):
reg lkofpoleconDJg c.sstranma5 c.geoslacknew6 polityma opencma5 ipervotema vturnma udima unempma realgdpgrma i.decades i.icountryb if corewest==1,  cl(icountryb)
est store s3m1e
reg  lwdiexpmil2 c.sstranma5 c.geoslacknew6 polityma opencma5 ipervotema vturnma udima unempma realgdpgrma i.decades i.icountryb if corewest==1,  cl(icountryb)
est store s3m2e
reg stdpartpow4b c.sstranma5 c.geoslacknew6 polityma opencma5 ipervotema vturnma udima unempma realgdpgrma i.decades i.icountryb if corewest==1,  cl(icountryb)
est store s3m3e
coefplot s3m1e s3m2e s3m3e, keep(sstranma5) xline(0) ylabel( .75 "...on PARTNERSHIP in Policy (KOF Index of Policy)" 1 "...on POWER in Policy (Military Exp., % GDP)" 1.25 "...on PARTNERSHIP+POWER (Standardized sum of Policies)") title("Effect of" "Social Security Transfers (%GDP) on...")
*Figure 3.2b (Right-hand panel):
margins, at(sstranma5=(3(5)23)) saving (mbasicn2, replace)
marginsplot ,  plotop(recast(line) lp(solid)) ciopts(lp(dash) recast(rline)) yt("Predicted Policy:" "Partnership+Power (Standardized sum of Policies)") xt("Social Security Transfers (% GDP)") title("Effect of Welfare Effort on PARTNERSHIP + POWER")


*Figure 3.3
use "mpdipolatepartyyear4-replic.dta"
tsset
*Figure 3.3a (Left-hand panel)
xi: reg lnetpartnership c.sstranma5  i.adjparfamadj4 c.ppolityma5 c.opencma5 c.unempma5 ipervotema5 irileadjLibInt i.decades i.icountryb if corewest==1, cl(icountryb)
margins, at(sstranma5=(3(3)23)) saving (mtb1b, replace)
xi: reg linetpromil c.sstranma5  i.adjparfamadj4 c.ppolityma5 c.opencma5 c.unempma5 ipervotema5 irileadjLibInt i.decades i.icountryb if corewest==1, cl(icountryb)
margins, at(sstranma5=(3(.5)23)) saving (mtb2b, replace)
xi: reg lnetlibint c.sstranma5  i.adjparfamadj4 c.ppolityma5 c.opencma5 c.unempma5 ipervotema5 irileadjLibInt i.decades i.icountryb if corewest==1, cl(icountryb)
margins, at(sstranma5=(3(.5)23)) saving (mtb3b, replace)
combomarginsplot mtb3b mtb1b mtb2b,  plotop(recast(line) lp(solid)) ciopts(lp(dash) recast(rline)) yt("Predicted Platform on Average:" "Partnership, Power, Power+Partnership") xt("Social Security Transfers (% GDP)") title("Effect of Welfare Effort on PARTNERSHIP and POWER in party platforms") legend(off)
*Figure 3.3b (Right-hand panel):
xi: reg lnetlibint c.sstranma5##i.adjparfamadj4 c.ppolityma5 c.opencma5 c.unempma5 ipervotema5 irileadjLibInt i.decades i.icountryb if corewest==1, cl(icountryb)
margins adjparfamadj4 if adjparfamadj4>1, dydx(sstranma5)
marginsplot, yline(0) recast(scatter) xlabel(2 "Radical Left" 3 "Social Democrat" 4 "Liberal" 5 "Christ.Democ." 6 "Conserv." 7 "Radical Right") 


*Figure 3.4
use "mpdipolatepartyyear4-replic.dta"
tsset
xi: reg lnetpartnervoteweight c.sstranma5 i.adjparfamadj4 c.ppolityma5 c.lkofgidfma5 c.unempma5 ipervotema5 irileadjLibInt i.decades i.icountryb if corewest==1, cl(icountryb)
margins, at(sstranma5=(3(3)23)) saving (m1b, replace)
xi: reg linetpromilvoteweight c.sstranma5  i.adjparfamadj4 c.ppolityma5 c.lwdiexpmil2ma5 c.unempma5 ipervotema5 irileadjLibInt i.decades i.icountryb if corewest==1, cl(icountryb)
margins, at(sstranma5=(3(.5)23)) saving (m2b, replace)
xi: reg lnetlibintvoteweight c.sstranma5  i.adjparfamadj4 c.ppolityma5 c.lkofgidfma5 c.lwdiexpmil2ma5 c.unempma5 ipervotema5 irileadjLibInt i.decades i.icountryb if corewest==1, cl(icountryb)
margins, at(sstranma5=(3(.5)23)) saving (m3b, replace)
combomarginsplot m3b  m1b m2b,  plotop(recast(line) lp(solid)) ciopts(lp(dash) recast(rline)) yt("Predicted Voter Support:" "Net Partnership, Power, Power+Partnership") xt("Social Security Transfers (% GDP)") title("Effect of Welfare Effort on Voter support PARTNERSHIP and POWER") legend(off)


*Figure 3.5
use "TBpopcntryyearcpds2c-replic.dta"
gr twoway line sstrancwyr year2 if year2>1959&icountryb==61, yaxis(1) ytitle("Social security transfers as % GDP") || line sstranperunemp3cwyr2 year2 if year2>1959&icountryb==61, yaxis(2) ytitle("Social security transfers normalized" "by unemployment rate", axis(2)) legend(off)


*Figure 3.6
*Figure 3.6a:
gr twoway line geoslack6agn2CoreWyr year2 if year2>1949&icountryb==61, ytitle("Geopolitical threat index for West (mean)") legend(off)
*Figure 3.6b:
gr twoway line geoslack6agn2EUyr year2 if icountryb==51&year2>1949, ytitle("Geopolitical threat index for West (mean)" "  " "  " "  ") ||  line geoslack6again2 year2 if icountryb==61&year2>1949 ||  line geoslack6again2 year2 if icountryb==71&year2>1949 

*Figure 3.7
sc stdpartpow4b geoslacknew6cntry if corewest==1&year2==2010, ml(icountry) ytitle("Support for liberal internationalism" "(partnership + power)") xtitle("Geopolitical threat score") || lfitci  stdpartpow4b geoslacknew6cntry if corewest==1&year2==2010, legend(off) ciplot(rline)
 

*Figure 3.8
use "TBpopcntryyearcpds2c-replic.dta"
*Figure 3.8a (Left-hand panel):
reg lkofpoleconDJg c.sstranma5 c.geoslacknew6 polityma opencma5 ipervotema vturnma udima unempma realgdpgrma i.decades i.icountryb if corewest==1,  cl(icountryb)
est store s3m1e
reg  lwdiexpmil2 c.sstranma5 c.geoslacknew6 polityma opencma5 ipervotema vturnma udima unempma realgdpgrma i.decades i.icountryb if corewest==1,  cl(icountryb)
est store s3m2e
reg stdpartpow4b c.sstranma5 c.geoslacknew6 polityma opencma5 ipervotema vturnma udima unempma realgdpgrma i.decades i.icountryb if corewest==1,  cl(icountryb)
est store s3m3e
coefplot s3m1e s3m2e s3m3e, keep(geoslacknew6) xline(0) ylabel( .75 "...on PARTNERSHIP in Policy (KOF Index of Policy)" 1 "...on POWER in Policy (Military Exp., % GDP)" 1.25 "...on PARTNERSHIP+POWER (Standardized sum of Policies)") title("Effect of" "Geopolitical Threat Scale on...")
*Figure 3.8b (Right-hand panel):
margins, at(geoslacknew6=(-1.38(.45)1.57)) saving (mbasicn6, replace)
marginsplot ,  plotop(recast(line) lp(solid)) ciopts(lp(dash) recast(rline)) yt("Predicted Policy:" "Partnership + Power (Stand.sum of Policies") xt("Geopolitical Threat Scale")   title("Effect of Geopolitical Threat on PARTNERSHIP+POWER")


*Figure 3.9
use "mpdipolatepartyyear4-replic.dta"
tsset
*Figure 3.9a (Left-hand panel):
xi: reg lnetpartnership c.geoslacknew6 i.adjparfamadj4 c.ppolityma5 c.opencma5 c.unempma5 ipervotema5 irileadjLibInt i.decades i.icountryb if corewest==1, cl(icountryb)
margins,  at(geoslacknew6=(-1.5(.1)1.6)) saving (m1b, replace)
xi: reg linetpromil c.geoslacknew6 i.adjparfamadj4 c.ppolityma5 c.opencma5 c.unempma5 ipervotema5 irileadjLibInt i.decades i.icountryb if corewest==1, cl(icountryb)
margins,  at(geoslacknew6=(-1.5(.1)1.6)) saving (m2b, replace)
xi: reg lnetlibint c.geoslacknew6 i.adjparfamadj4 c.ppolityma5 c.opencma5 c.unempma5 ipervotema5 irileadjLibInt i.decades i.icountryb if corewest==1, cl(icountryb)
margins,  at(geoslacknew6=(-1.5(.1)1.6)) saving (m3b, replace)
combomarginsplot m3b  m1b m2b,  plotop(recast(line) lp(solid)) ciopts(lp(dash) recast(rline)) yt("Predicted Platform:" "Net Partnership, Power, Power+Partnership") xt("Geopolitical threat scale") title("Effect of Geopolitical Threat on PARTNERSHIP and POWER in Platforms") legend(off)
*Figure 3.9b (Right-hand panel) (coefficient plot of interaction geopolitical threat X party family)
xi: reg f.lnetlibint c.geoslacknew6##i.adjparfamadj4 c.polity2p4ma5 c.kofgidfma5 c.lwdiexpmil2ma5 c.unempma5 irileadj udima ipervotema i.decades i.icountryb if corewest==1&ipervotema5>0, cl(icountryb)
margins adjparfamadj4 if adjparfamadj4>1, dydx(geoslacknew6)
marginsplot, yline(0) recast(scatter)  xlabel(						///												///
	2 $rl 3 $sd 4 $l 5 $cd 6 $c 7 $rr, $labsize) yt("Effects of Geopolitical Threat scale" "on Partnership+Power in Platform")


*Figure 3.10
use "mpdipolatepartyyear4-replic.dta"
tsset
xi: reg lnetpartnervoteweight c.geoslacknew6  i.adjparfamadj4 c.ppolityma5 c.lkofgidfma5 c.unempma5 ipervotema5 irileadjLibInt i.decades i.icountryb if corewest==1, cl(icountryb)
margins, at(geoslacknew6=(-1.5(.1)1.6)) saving (m1c, replace)
xi: reg linetpromilvoteweight c.geoslacknew6  i.adjparfamadj4 c.ppolityma5 c.lwdiexpmil2ma5 c.unempma5 ipervotema5 irileadjLibInt i.decades i.icountryb if corewest==1, cl(icountryb)
margins, at(geoslacknew6=(-1.5(.1)1.6)) saving (m2c, replace)
xi: reg lnetlibintvoteweight c.geoslacknew6  i.adjparfamadj4 c.ppolityma5 c.lkofgidfma5 c.lwdiexpmil2ma5 c.unempma5 ipervotema5 irileadjLibInt i.decades i.icountryb if corewest==1, cl(icountryb)
margins, at(geoslacknew6=(-1.5(.1)1.6)) saving (m3c, replace)
combomarginsplot m3c m1c m2c,  plotop(recast(line) lp(solid)) ciopts(lp(dash) recast(rline)) yt("Predicted Voter support:" "Partnership, Power, Power+Partnership") xt("Geopolitical threat scale") title("Effect of Geopolitical threat on Voter support for PARTNERSHIP and POWER") legend(off)
		
	
*Figure 3.11
use "TBpopcntryyearcpds2c-replic.dta"
reg f.devnetpartvotelkofpolecg2 kofgidfg2ma irilema polityma5 govright1ma ipervotema vturnma udima unempma realgdpgrma i.decades i.icountryb if corewest==1, cl(icountryb) 
margins, at(kofgidfg2ma =(45.57652(5)89.96287)) saving (mtsolvency1, replace)
marginsplot, plotop(recast(line) lp(solid)) ciopts(lp(dash) recast(rline)) yt("Predicted Govt.-Voter Gap on Partnership") xt("KOF De Facto globalization") title("Effect of KOF De Facto Globalization")
graph save "Graph" "/Users/Burgoon/Downloads/TBfig3pt11a.gph"

reg f.devnetpartvotelkofpolecg2 kofgedfgma5 irilema polityma5 govright1ma ipervotema vturnma udima unempma realgdpgrma i.decades i.icountryb if corewest==1, cl(icountryb) 
margins, at(kofgedfgma =(18.972(5)91.32)) saving (mtsolvency2, replace)
marginsplot, plotop(recast(line) lp(solid)) ciopts(lp(dash) recast(rline)) yt("Predicted Govt.-Voter Gap on Partnership") xt("KOF De Facto ECONOMIC globalization") title("Effect of KOF De Facto Economic Glob.")
graph save "Graph" "/Users/Burgoon/Downloads/TBfig3pt11b.gph"

reg f.devnetpartvotelkofpolecg2 kofpogidfma irilema polityma5 govright1ma ipervotema vturnma udima unempma realgdpgrma i.decades i.icountryb if corewest==1, cl(icountryb) 
margins, at(kofpogidfma =(50(5)97.72436)) saving (mtsolvency3, replace)
marginsplot, plotop(recast(line) lp(solid)) ciopts(lp(dash) recast(rline)) yt("Predicted Govt.-Voter Gap on Partnership") xt("KOF De Facto POLITICAL globalization") title("Effect of KOF De Facto Political Glob.")
graph save "Graph" "/Users/Burgoon/Downloads/TBfig3pt11c.gph"

graph combine "/Users/Burgoon/Downloads/TBfig3pt11a.gph"  "/Users/Burgoon/Downloads/TBfig3pt11b.gph" "/Users/Burgoon/Downloads/TBfig3pt11c.gph", col(3) xsiz(6) ysiz(4)						///
	plotr(lc(white)) graphr(m(2 2 2 2) fc(white) lc(white)) scale(.85)

	
*******************
* Chapter 4 Figures
*******************	
	
*Figure 4.1
use "TBpopcntryyearcpds2c-replic.dta"
sc lnetpartnership linetpromil if adjparfamadj4>2&adjparfamadj4<7&linetpromil!=0&lnetpartnership!=0&fullwestgood==1&year2>1949&year2<1976, mfc(midblue) mlc(midblue) || sc lnetpartnership linetpromil if adjparfamadj4==2&linetpromil!=0&lnetpartnership!=0&fullwestgood==1&year2>1949&year2<1976, msize(vsmall) mfc(emerald) mlc(emerald) || sc lnetpartnership linetpromil if adjparfamadj4==7&linetpromil!=0&lnetpartnership!=0&fullwestgood==1&year2>1949&year2<1976, msize(vsmall) mfc(red) mlc(red)  || sc lnetpartnershipMav5075 linetpromilMav5075 if icountryb==51&year2>1949&year2<1976   || sc lnetpartnershipRLav5075 linetpromilRLav5075 if icountryb==13&year2>1949&year2<1976 || sc lnetpartnershipRRav linetpromilRRav if icountryb==42&year2>1949&year2<1976 || sc lnetpartnershipSDav5075 linetpromilSDav5075 if icountryb==51&year2>1949&year2<1976  || sc lnetpartnershipLav5075 linetpromilLav5075 if icountryb==51&year2>1949&year2<1976   || sc lnetpartnershipCDav5075 linetpromilCDav5075 if icountryb==41&year2>1949&year2<1976 || sc lnetpartnershipCav5075 linetpromilCav5075 if icountryb==51&year2>1949&year2<1976, legend(label(1 "Mainstream party-year") label( 2 "Radical Left party-year") label( 3 "Radical Right party-year")  label( 4 "Mainstream party mean")  label( 5 "Radical Left party mean") label( 6 "Radical Right party mean") label( 7 "Soc.Dem. mean") label( 8 "Liberal mean")  label( 9 "Christ.Dem. mean") label( 10 "Conservative mean")) ytitle("Party support for partnership") xtitle("Party support for power") title("Party support for partnership and power, 1950-75") legend(label(1 "Mainstream party-year") label( 2 "Radical Left party-year") label( 3 "Radical Right party-year")  label( 4 "Mainstream party mean")  label( 5 "Radical Left party mean") label( 6 "Radical Right party mean") label( 7 "Soc.Dem. mean") label( 8 "Liberal mean")  label( 9 "Christ.Dem. mean") label( 10 "Conservative mean"))
*corewest
sc lnetpartnership linetpromil if adjparfamadj4>2&adjparfamadj4<7&linetpromil!=0&lnetpartnership!=0&corewest==1&year2>1949&year2<1976, mfc(midblue) mlc(midblue) || sc lnetpartnership linetpromil if adjparfamadj4==2&linetpromil!=0&lnetpartnership!=0&corewest==1&year2>1949&year2<1976, msize(vsmall) mfc(emerald) mlc(emerald) || sc lnetpartnership linetpromil if adjparfamadj4==7&linetpromil!=0&lnetpartnership!=0&corewest==1&year2>1949&year2<1976, msize(vsmall) mfc(red) mlc(red) || sc lnetpartnershipMavcw5075 linetpromilMavcw5075 if icountryb==51&year2>1949&year2<1976   || sc lnetpartnershipRLavcw5075 linetpromilRLavcw5075 if icountryb==13&year2>1949&year2<1976 || sc lnetpartnershipRRavcw5075 linetpromilRRavcw5075 if icountryb==42&year2>1949&year2<1976 || sc lnetpartnershipSDavcw5075 linetpromilSDavcw5075 if icountryb==51&year2>1949&year2<1976  || sc lnetpartnershipLavcw5075 linetpromilLavcw5075 if icountryb==51&year2>1949&year2<1976   || sc lnetpartnershipCDavcw5075 linetpromilCDavcw5075 if icountryb==41&year2>1949&year2<1976 || sc lnetpartnershipCavcw5075 linetpromilCavcw5075 if icountryb==51&year2>1949&year2<1976, legend(label(1 "Mainstream party-year") label( 2 "Radical Left party-year") label( 3 "Radical Right party-year")  label( 4 "Mainstream party mean")  label( 5 "Radical Left party mean") label( 6 "Radical Right party mean") label( 7 "Soc.Dem. mean") label( 8 "Liberal mean")  label( 9 "Christ.Dem. mean") label( 10 "Conservative mean")) ytitle("Party support for partnership") xtitle("Party support for power") title("Party support for partnership and power, 1950-75") legend(label(1 "Mainstream party-year") label( 2 "Radical Left party-year") label( 3 "Radical Right party-year")  label( 4 "Mainstream party mean")  label( 5 "Radical Left party mean") label( 6 "Radical Right party mean") label( 7 "Soc.Dem. mean") label( 8 "Liberal mean")  label( 9 "Christ.Dem. mean") label( 10 "Conservative mean")) yline(1.22468) xline(0.280662)
*corewest and fullwest
sc lnetpartnership linetpromil if adjparfamadj4>2&adjparfamadj4<7&linetpromil!=0&lnetpartnership!=0&corewest==1&fullwestgood==1&year2>1949&year2<1976, mfc(midblue) mlc(midblue) || sc lnetpartnership linetpromil if adjparfamadj4==2&linetpromil!=0&lnetpartnership!=0&corewest==1&fullwestgood==1&year2>1949&year2<1976, msize(vsmall) mfc(emerald) mlc(emerald) || sc lnetpartnership linetpromil if adjparfamadj4==7&linetpromil!=0&lnetpartnership!=0&corewest==1&fullwestgood==1&year2>1949&year2<1976, msize(vsmall) mfc(cranberry) mlc(cranberry) || sc lnetpartnershipMavcw5075 linetpromilMavcw5075 if icountryb==51&year2>1949&year2<1976   || sc lnetpartnershipRLavcw5075 linetpromilRLavcw5075 if icountryb==13&year2>1949&year2<1976 || sc lnetpartnershipRRavcw5075 linetpromilRRavcw5075 if icountryb==42&year2>1949&year2<1976 || sc lnetpartnershipSDavcw5075 linetpromilSDavcw5075 if icountryb==51&year2>1949&year2<1976  || sc lnetpartnershipLavcw5075 linetpromilLavcw5075 if icountryb==51&year2>1949&year2<1976   || sc lnetpartnershipCDavcw5075 linetpromilCDavcw5075 if icountryb==41&year2>1949&year2<1976 || sc lnetpartnershipCavcw5075 linetpromilCavcw5075 if icountryb==51&year2>1949&year2<1976, legend(label(1 "Mainstream party-year") label( 2 "Radical Left party-year") label( 3 "Radical Right party-year")  label( 4 "Mainstream party mean")  label( 5 "Radical Left party mean") label( 6 "Radical Right party mean") label( 7 "Soc.Dem. mean") label( 8 "Liberal mean")  label( 9 "Christ.Dem. mean") label( 10 "Conservative mean")) ytitle("Party support for partnership") xtitle("Party support for power") title("Party support for partnership and power, 1950-75") legend(label(1 "Mainstream party-year") label( 2 "Radical Left party-year") label( 3 "Radical Right party-year")  label( 4 "Mainstream party mean")  label( 5 "Radical Left party mean") label( 6 "Radical Right party mean") label( 7 "Soc.Dem. mean") label( 8 "Liberal mean")  label( 9 "Christ.Dem. mean") label( 10 "Conservative mean")) yline(1.22468) xline(0.280662)
*corewest with fullwest detail
sc lnetpartnership linetpromil if adjparfamadj4>2&adjparfamadj4<7&linetpromil!=0&lnetpartnership!=0&fullwestgood==1&year2>1949&year2<1976, mfc(midblue) mlc(midblue) || sc lnetpartnership linetpromil if adjparfamadj4==2&linetpromil!=0&lnetpartnership!=0&fullwestgood==1&year2>1949&year2<1976, msize(vsmall) mfc(emerald) mlc(emerald) || sc lnetpartnership linetpromil if adjparfamadj4==7&linetpromil!=0&lnetpartnership!=0&fullwestgood==1&year2>1949&year2<1976, msize(vsmall) mfc(cranberry) mlc(cranberry) || sc lnetpartnershipMavcw5075 linetpromilMavcw5075 if icountryb==51&year2>1949&year2<1976   || sc lnetpartnershipRLavcw5075 linetpromilRLavcw5075 if icountryb==13&year2>1949&year2<1976 || sc lnetpartnershipRRavcw5075 linetpromilRRavcw5075 if icountryb==42&year2>1949&year2<1976 || sc lnetpartnershipSDavcw5075 linetpromilSDavcw5075 if icountryb==51&year2>1949&year2<1976  || sc lnetpartnershipLavcw5075 linetpromilLavcw5075 if icountryb==51&year2>1949&year2<1976   || sc lnetpartnershipCDavcw5075 linetpromilCDavcw5075 if icountryb==41&year2>1949&year2<1976 || sc lnetpartnershipCavcw5075 linetpromilCavcw5075 if icountryb==51&year2>1949&year2<1976, legend(label(1 "Mainstream parties") label( 2 "Radical Left parties") label( 3 "Radical Right parties")  label( 4 "Mainstream mean")  label( 5 "Radical Left mean") label( 6 "Radical Right mean") label( 7 "Social Dem mean") label( 8 "Liberal mean")  label( 9 "Christ Dem mean") label( 10 "Conservative mean")) ytitle("Party platform support for partnership") xtitle("Party platform support for power") legend(label(1 "Mainstream parties") label( 2 "Radical Left parties") label( 3 "Radical Right parties")  label( 4 "Mainstream mean")  label( 5 "Radical Left mean") label( 6 "Radical Right mean") label( 7 "Soc Dem mean") label( 8 "Liberal mean")  label( 9 "Christ Dem mean") label( 10 "Conservative mean")) yline(1.22468) xline(0.280662) legend(cols(4))

*Figure 4.2
use "mpdipolatepartyyear4-replic.dta"
sc lnetpartnership linetpromil if adjparfamadj4>2&adjparfamadj4<7&linetpromil!=0&lnetpartnership!=0&fullwestgood==1&year2>1975&year2<1992, msize(vsmall) mfc(midblue) mlc(midblue) || sc lnetpartnership linetpromil if adjparfamadj4==2&linetpromil!=0&lnetpartnership!=0&fullwestgood==1&year2>1975&year2<1992, msize(vsmall) mfc(emerald) mlc(emerald) || sc lnetpartnership linetpromil if adjparfamadj4==7&linetpromil!=0&lnetpartnership!=0&fullwestgood==1&year2>1975&year2<1992, msize(vsmall) mfc(red) mlc(red)  || sc lnetpartnershipMav7691 linetpromilMav7691 if icountryb==51&year2>1975&year2<1992   || sc lnetpartnershipRLav7691 linetpromilRLav7691 if icountryb==34&year2>1975&year2<1992 || sc lnetpartnershipRRav7691 linetpromilRRav7691 if icountryb==42&year2>1975&year2<1992 || sc lnetpartnershipSDav7691 linetpromilSDav7691 if icountryb==51&year2>1975&year2<1992  || sc lnetpartnershipLav7691 linetpromilLav7691 if icountryb==51&year2>1975&year2<1992   || sc lnetpartnershipCDav7691 linetpromilCDav7691 if icountryb==41&year2>1975&year2<1992 || sc lnetpartnershipCav7691 linetpromilCav7691 if icountryb==51&year2>1975&year2<1992, legend(label(1 "Mainstream party-year") label( 2 "Radical Left party-year") label( 3 "Radical Right party-year")  label( 4 "Mainstream party mean")  label( 5 "Radical Left party mean") label( 6 "Radical Right party mean") label( 7 "Soc.Dem. mean") label( 8 "Liberal mean")  label( 9 "Christ.Dem. mean") label( 10 "Conservative mean")) ytitle("Party support for partnership") xtitle("Party support for power") title("Party support for partnership and power, 1976-91")
* corewest and fullwest:
sc lnetpartnership linetpromil if adjparfamadj4>2&adjparfamadj4<7&linetpromil!=0&lnetpartnership!=0&corewest==1&fullwestgood==1&year2>1975&year2<1992, msize(vsmall) mfc(midblue) mlc(midblue) || sc lnetpartnership linetpromil if adjparfamadj4==2&linetpromil!=0&lnetpartnership!=0&corewest==1&fullwestgood==1&year2>1975&year2<1992, msize(vsmall) mfc(emerald) mlc(emerald) || sc lnetpartnership linetpromil if adjparfamadj4==7&linetpromil!=0&lnetpartnership!=0&corewest==1&fullwestgood==1&year2>1975&year2<1992, msize(vsmall) mfc(cranberry) mlc(cranberry)  || sc lnetpartnershipMavcw7691 linetpromilMavcw7691 if icountryb==51&year2>1975&year2<1992   || sc lnetpartnershipRLavcw7691 linetpromilRLavcw7691 if icountryb==34&year2>1975&year2<1992 || sc lnetpartnershipRRavcw7691 linetpromilRRavcw7691 if icountryb==42&year2>1975&year2<1992 || sc lnetpartnershipSDavcw7691 linetpromilSDavcw7691 if icountryb==51&year2>1975&year2<1992  || sc lnetpartnershipLavcw7691 linetpromilLavcw7691 if icountryb==51&year2>1975&year2<1992   || sc lnetpartnershipCDavcw7691 linetpromilCDavcw7691 if icountryb==41&year2>1975&year2<1992 || sc lnetpartnershipCavcw7691 linetpromilCavcw7691 if icountryb==51&year2>1975&year2<1992, legend(label(1 "Mainstream party-year") label( 2 "Radical Left party-year") label( 3 "Radical Right party-year")  label( 4 "Mainstream party mean")  label( 5 "Radical Left party mean") label( 6 "Radical Right party mean") label( 7 "Soc.Dem. mean") label( 8 "Liberal mean")  label( 9 "Christ.Dem. mean") label( 10 "Conservative mean")) ytitle("Party support for partnership") xtitle("Party support for power") title("Party support for partnership and power, 1976-91") yline(1.22468) xline(0.280662)
* corewest with fullwest:
sc lnetpartnership linetpromil if adjparfamadj4>2&adjparfamadj4<7&linetpromil!=0&lnetpartnership!=0&fullwestgood==1&year2>1975&year2<1992, msize(vsmall) mfc(midblue) mlc(midblue) || sc lnetpartnership linetpromil if adjparfamadj4==2&linetpromil!=0&lnetpartnership!=0&fullwestgood==1&year2>1975&year2<1992, msize(vsmall) mfc(emerald) mlc(emerald) || sc lnetpartnership linetpromil if adjparfamadj4==7&linetpromil!=0&lnetpartnership!=0&fullwestgood==1&year2>1975&year2<1992, msize(vsmall) mfc(cranberry) mlc(cranberry)  || sc lnetpartnershipMavcw7691 linetpromilMavcw7691 if icountryb==51&year2>1975&year2<1992   || sc lnetpartnershipRLavcw7691 linetpromilRLavcw7691 if icountryb==34&year2>1975&year2<1992 || sc lnetpartnershipRRavcw7691 linetpromilRRavcw7691 if icountryb==42&year2>1975&year2<1992 || sc lnetpartnershipSDavcw7691 linetpromilSDavcw7691 if icountryb==51&year2>1975&year2<1992  || sc lnetpartnershipLavcw7691 linetpromilLavcw7691 if icountryb==51&year2>1975&year2<1992   || sc lnetpartnershipCDavcw7691 linetpromilCDavcw7691 if icountryb==41&year2>1975&year2<1992 || sc lnetpartnershipCavcw7691 linetpromilCavcw7691 if icountryb==51&year2>1975&year2<1992, legend(label(1 "Mainstream parties") label( 2 "Radical Left parties") label( 3 "Radical Right parties")  label( 4 "Mainstream mean")  label( 5 "Radical Left mean") label( 6 "Radical Right mean") label( 7 "Social Dem mean") label( 8 "Liberal mean")  label( 9 "Christ Dem mean") label( 10 "Conservative mean")) ytitle("Party platform support for partnership") xtitle("Party platform support for power") legend(label(1 "Mainstream parties") label( 2 "Radical Left parties") label( 3 "Radical Right parties")  label( 4 "Mainstream mean")  label( 5 "Radical Left mean") label( 6 "Radical Right mean") label( 7 "Soc Dem mean") label( 8 "Liberal mean")  label( 9 "Christ Dem mean") label( 10 "Conservative mean")) yline(1.22468) xline(0.280662) legend(cols(4))
	
	
*Figure 4.3
use "TBpopcntryyearcpds2c-replic.dta"
*Figure 4.3a (Left-hand panel on partnership)
xi: sureg (flkofpoleconDJg  iipervoteM3cy l4.kofgidfgma5 polityma ipervotema vturnma udima unempma realgdpgrma i.decades i.icountryb if corewest==1) (flwdiexpmil2  iipervoteM3cy l4.kofgidfgma5 polityma ipervotema vturnma udima unempma realgdpgrma i.decades i.icountryb if corewest==1) (stdpartpow4b  iipervoteM3cy l4.kofgidfgma5 polityma ipervotema vturnma udima unempma realgdpgrma i.decades i.icountryb if corewest==1), 
 suregr, cluster(icountryb)
est store m1a
xi: sureg (flkofpoleconDJg  iipervoteRR3cy l4.kofgidfgma5 polityma ipervotema vturnma udima unempma realgdpgrma i.decades i.icountryb if corewest==1) (flwdiexpmil2  iipervoteRR3cy l4.kofgidfgma5 polityma ipervotema vturnma udima unempma realgdpgrma i.decades i.icountryb if corewest==1) (stdpartpow4b  iipervoteRR3cy l4.kofgidfgma5 polityma ipervotema vturnma udima unempma realgdpgrma i.decades i.icountryb if corewest==1), 
 suregr, cluster(icountryb)
est store m1b
xi: sureg (flkofpoleconDJg  iipervoteRL3cy l4.kofgidfgma5 polityma ipervotema vturnma udima unempma realgdpgrma i.decades i.icountryb if corewest==1) (flwdiexpmil2  iipervoteRL3cy l4.kofgidfgma5 polityma ipervotema vturnma udima unempma realgdpgrma i.decades i.icountryb if corewest==1) (stdpartpow4b  iipervoteRL3cy l4.kofgidfgma5 polityma ipervotema vturnma udima unempma realgdpgrma i.decades i.icountryb if corewest==1), 
 suregr, cluster(icountryb)
est store m1c
xi: sureg (flkofpoleconDJg  iipervoteRRRL3cy l4.kofgidfgma5 polityma ipervotema vturnma udima unempma realgdpgrma i.decades i.icountryb if corewest==1) (flwdiexpmil2  iipervoteRRRL3cy l4.kofgidfgma5 polityma ipervotema vturnma udima unempma realgdpgrma i.decades i.icountryb if corewest==1) (stdpartpow4b  iipervoteRRRL3cy l4.kofgidfgma5 polityma ipervotema vturnma udima unempma realgdpgrma i.decades i.icountryb if corewest==1), 
 suregr, cluster(icountryb)
est store m1cc
xi: sureg (flkofpoleconDJg  ipervoteMminRRRL3cy3 l4.kofgidfgma5 polityma ipervotema vturnma udima unempma realgdpgrma i.decades i.icountryb if corewest==1) (flwdiexpmil2  ipervoteMminRRRL3cy3 l4.kofgidfgma5 polityma ipervotema vturnma udima unempma realgdpgrma i.decades i.icountryb if corewest==1) (stdpartpow4b  ipervoteMminRRRL3cy3 l4.kofgidfgma5 polityma ipervotema vturnma udima unempma realgdpgrma i.decades i.icountryb if corewest==1), 
 suregr, cluster(icountryb)
est store m1d
xi: sureg (flkofpoleconDJg lnetpartnervotewghtM3cyma l4.kofgidfgma5 polityma ipervotema vturnma udima unempma realgdpgrma i.decades i.icountryb if corewest==1) (flwdiexpmil2  ilnetpromilvotewghtM3cyma l4.kofgidfgma5 polityma ipervotema vturnma udima unempma realgdpgrma i.decades i.icountryb if corewest==1) (fstdpartpow4b  lnetlibintlvoteweightM3cyma l4.kofgidfgma5 polityma ipervotema vturnma udima unempma realgdpgrma i.decades i.icountryb if corewest==1), 
 suregr, cluster(icountryb)
est store m1e
coefplot (m1a m1b m1c m1cc m1d m1e), keep(iipervoteM3cy iipervoteRR3cy iipervoteRL3cy iipervoteRRRL3cy ipervoteMminRRRL3cy3) xline(0) ylabel( 1 "Mainstream vote share" 2 "Radical Right vote share" 3 "Radical Left vote share" 4 "All Radical vote share" 5 "Net Mainstream vote share") title("Partnership in Policy (KOF Policy Index)")

*Figure 4.3b (Center panel on power)
xi: sureg (flwdiexpmil2  iipervoteM3cy l4.kofgidfgma5 polityma ipervotema vturnma udima unempma realgdpgrma i.decades i.icountryb if corewest==1) (flkofpoleconDJg  iipervoteM3cy l4.kofgidfgma5 polityma ipervotema vturnma udima unempma realgdpgrma i.decades i.icountryb if corewest==1)  (stdpartpow4b  iipervoteM3cy l4.kofgidfgma5 polityma ipervotema vturnma udima unempma realgdpgrma i.decades i.icountryb if corewest==1), 
 suregr, cluster(icountryb)
est store m2a
xi: sureg (flwdiexpmil2  iipervoteRR3cy l4.kofgidfgma5 polityma ipervotema vturnma udima unempma realgdpgrma i.decades i.icountryb if corewest==1) (flkofpoleconDJg  iipervoteRR3cy l4.kofgidfgma5 polityma ipervotema vturnma udima unempma realgdpgrma i.decades i.icountryb if corewest==1)  (stdpartpow4b  iipervoteRR3cy l4.kofgidfgma5 polityma ipervotema vturnma udima unempma realgdpgrma i.decades i.icountryb if corewest==1), 
 suregr, cluster(icountryb)
est store m2b
xi: sureg  (flwdiexpmil2  iipervoteRL3cy l4.kofgidfgma5 polityma ipervotema vturnma udima unempma realgdpgrma i.decades i.icountryb if corewest==1) (flkofpoleconDJg  iipervoteRL3cy l4.kofgidfgma5 polityma ipervotema vturnma udima unempma realgdpgrma i.decades i.icountryb if corewest==1) (stdpartpow4b  iipervoteRL3cy l4.kofgidfgma5 polityma ipervotema vturnma udima unempma realgdpgrma i.decades i.icountryb if corewest==1), 
 suregr, cluster(icountryb)
est store m2c
xi: sureg (flwdiexpmil2  iipervoteRRRL3cy l4.kofgidfgma5 polityma ipervotema vturnma udima unempma realgdpgrma i.decades i.icountryb if corewest==1) (flkofpoleconDJg  iipervoteRRRL3cy l4.kofgidfgma5 polityma ipervotema vturnma udima unempma realgdpgrma i.decades i.icountryb if corewest==1)  (stdpartpow4b  iipervoteRRRL3cy l4.kofgidfgma5 polityma ipervotema vturnma udima unempma realgdpgrma i.decades i.icountryb if corewest==1), 
 suregr, cluster(icountryb)
est store m2cc
xi: sureg  (flwdiexpmil2  ipervoteMminRRRL3cy3 l4.kofgidfgma5 polityma ipervotema vturnma udima unempma realgdpgrma i.decades i.icountryb if corewest==1) (flkofpoleconDJg  ipervoteMminRRRL3cy3 l4.kofgidfgma5 polityma ipervotema vturnma udima unempma realgdpgrma i.decades i.icountryb if corewest==1) (stdpartpow4b  ipervoteMminRRRL3cy3 l4.kofgidfgma5 polityma ipervotema vturnma udima unempma realgdpgrma i.decades i.icountryb if corewest==1), 
 suregr, cluster(icountryb)
est store m2d
xi: sureg  (flwdiexpmil2  ilnetpromilvotewghtM3cyma l4.kofgidfgma5 polityma ipervotema vturnma udima unempma realgdpgrma i.decades i.icountry if corewest==1) (flkofpoleconDJg lnetpartnervotewghtM3cyma l4.kofgidfgma5 polityma ipervotema vturnma udima unempma realgdpgrma i.decades i.icountry if corewest==1) (fstdpartpow4b  lnetlibintlvoteweightM3cyma l4.kofgidfgma5 polityma ipervotema vturnma udima unempma realgdpgrma i.decades i.icountry if corewest==1), 
 suregr, cluster(icountryb)
est store m2e
coefplot (m2a m2b m2c m2cc m2d m2e), keep(iipervoteM3cy iipervoteRR3cy iipervoteRL3cy iipervoteRRRL3cy ipervoteMminRRRL3cy3) xline(0) ylabel( 1 "Mainstream vote share" 2 "Radical Right vote share" 3 "Radical Left vote share" 4 "All Radical vote share" 5 "Net Mainstream vote share") title("Power in Policy (Military spending % GDP)")

*Figure 4.3c (Right-hand panel on partnreship+power)
xi: sureg (stdpartpow4b iipervoteM3cy l4.kofgidfgma5 polityma ipervotema vturnma udima unempma realgdpgrma i.decades i.icountryb if corewest==1) (flkofpoleconDJg  iipervoteM3cy l4.kofgidfgma5 polityma ipervotema vturnma udima unempma realgdpgrma i.decades i.icountryb if corewest==1)  ( flwdiexpmil2  iipervoteM3cy l4.kofgidfgma5 polityma ipervotema vturnma udima unempma realgdpgrma i.decades i.icountryb if corewest==1), 
 suregr, cluster(icountryb)
est store m3a
xi: sureg (stdpartpow4b   iipervoteRR3cy l4.kofgidfgma5 polityma ipervotema vturnma udima unempma realgdpgrma i.decades i.icountryb if corewest==1) (flkofpoleconDJg  iipervoteRR3cy l4.kofgidfgma5 polityma ipervotema vturnma udima unempma realgdpgrma i.decades i.icountryb if corewest==1)  ( flwdiexpmil2  iipervoteRR3cy l4.kofgidfgma5 polityma ipervotema vturnma udima unempma realgdpgrma i.decades i.icountryb if corewest==1), 
 suregr, cluster(icountryb)
est store m3b
xi: sureg  (stdpartpow4b   iipervoteRL3cy l4.kofgidfgma5 polityma ipervotema vturnma udima unempma realgdpgrma i.decades i.icountryb if corewest==1) (flkofpoleconDJg  iipervoteRL3cy l4.kofgidfgma5 polityma ipervotema vturnma udima unempma realgdpgrma i.decades i.icountryb if corewest==1) ( flwdiexpmil2  iipervoteRL3cy l4.kofgidfgma5 polityma ipervotema vturnma udima unempma realgdpgrma i.decades i.icountryb if corewest==1), 
 suregr, cluster(icountryb)
est store m3c
xi: sureg (stdpartpow4b  iipervoteRRRL3cy l4.kofgidfgma5 polityma ipervotema vturnma udima unempma realgdpgrma i.decades i.icountryb if corewest==1) (flkofpoleconDJg  iipervoteRRRL3cy l4.kofgidfgma5 polityma ipervotema vturnma udima unempma realgdpgrma i.decades i.icountryb if corewest==1)  ( flwdiexpmil2  iipervoteRRRL3cy l4.kofgidfgma5 polityma ipervotema vturnma udima unempma realgdpgrma i.decades i.icountryb if corewest==1), 
 suregr, cluster(icountryb)
est store m3cc
xi: sureg  (stdpartpow4b  ipervoteMminRRRL3cy3 l4.kofgidfgma5 polityma ipervotema vturnma udima unempma realgdpgrma i.decades i.icountryb if corewest==1) (flkofpoleconDJg  ipervoteMminRRRL3cy3 l4.kofgidfgma5 polityma ipervotema vturnma udima unempma realgdpgrma i.decades i.icountryb if corewest==1) ( flwdiexpmil2  ipervoteMminRRRL3cy3 l4.kofgidfgma5 polityma ipervotema vturnma udima unempma realgdpgrma i.decades i.icountryb if corewest==1), 
 suregr, cluster(icountryb)
est store m3d
xi: sureg  (stdpartpow4b lnetlibintlvoteweightM3cyma  l4.kofgidfgma5 polityma ipervotema vturnma udima unempma realgdpgrma i.decades i.icountryb if corewest==1) (flkofpoleconDJg  lnetpartnervotewghtM3cyma  l4.kofgidfgma5 polityma ipervotema vturnma udima unempma realgdpgrma i.decades i.icountryb if corewest==1) ( flwdiexpmil2  ilnetpromilvotewghtM3cyma l4.kofgidfgma5 polityma ipervotema vturnma udima unempma realgdpgrma i.decades i.icountryb if corewest==1), 
 suregr, cluster(icountryb)
est store m3e
coefplot (m3a m3b m3c m3cc m3d m3e), keep(iipervoteM3cy iipervoteRR3cy iipervoteRL3cy iipervoteRRRL3cy ipervoteMminRRRL3cy3) xline(0) ylabel( 1 "Mainstream vote share" 2 "Radical Right vote share" 3 "Radical Left vote share" 4 "All Radical vote share" 5 "Net Mainstream vote share") title("Partnership + Power in Policy")



*Figure 4.4:
use "TBpopcntryyearcpds2c-replic.dta"
*Run models for Figure 4.3
*Figure 4.4a (Left-hand panel for mainstream parties' vote share)
est restore m3a
margins, at(iipervoteM3cy=(0(5)99)) predict(equation(stdpartpow4b)) saving (mbdev5b1, replace) 
marginsplot, plotop(recast(line) lp(solid)) ciopts(lp(dash) recast(rline)) yt("Predicted Policy of Partnership + Power") xt("Mainstream party vote share") title("Effect of Mainstream vote-share on" "Policy of Partnership + Power")
*Figure 4.4b (Right-hand panel for RR and RL parties' vote share')
est restore m3cc
sum iipervoteRRRL3cy if corewest==1, detail
margins, at(iipervoteRRRL3cy=(0(5)56)) predict(equation(stdpartpow4b)) saving (mbdevRRRL, replace) 
 marginsplot, plotop(recast(line) lp(solid)) ciopts(lp(dash) recast(rline)) yt("Predicted Policy of Partnership + Power") xt("Radical Left and Radical Right party vote share") title("Effect of Radical-party vote-share on" "Policy of Partnership+ Power")

 
 *Figure 4.5
use "TBpopcntryyearcpds2c-replic.dta"
gr twoway line  iipervoteM3cymacwyr412 year2 if year2>1949&year2<2018&corewest==1, yaxis(1) sort(year2) ytitle("Mainstream party vote share")  || line iipervoteRR3cymacwyr412 year2 if year2>1949&year2<2018&corewest==1, yaxis(2) sort(year2)  || line iipervoteRL3cymacwyr412 year2 if year2>1949&year2<2018&corewest==1, yaxis(2)  sort(year2)  ytitle("Radical right and left vote shares", axis(2))

 
* Figure 4.6
use "mpdipolatepartyyear4-replic.dta"
sc lnetpartnership linetpromil if adjparfamadj4>2&adjparfamadj4<7&linetpromil!=0&lnetpartnership!=0&fullwestgood==1&year2>1991, msize(vsmall) mfc(midblue) mlc(midblue) || sc lnetpartnership linetpromil if adjparfamadj4==2&linetpromil!=0&lnetpartnership!=0&fullwestgood==1&year2>1991, msize(vsmall) mfc(emerald) mlc(emerald) || sc lnetpartnership linetpromil if adjparfamadj4==7&linetpromil!=0&lnetpartnership!=0&fullwestgood==1&year2>1991, msize(vsmall) mfc(red) mlc(red)  || sc lnetpartnershipMav9217 linetpromilMav9217 if icountryb==51&year2>1991   || sc lnetpartnershipRLav9217 linetpromilRLav9217 if icountryb==34&year2>1991 || sc lnetpartnershipRRav9217 linetpromilRRav9217 if icountryb==42&year2>1991 || sc lnetpartnershipSDav9217 linetpromilSDav9217 if icountryb==51&year2>1991  || sc lnetpartnershipLav9217 linetpromilLav9217 if icountryb==51&year2>1991   || sc lnetpartnershipCDav9217 linetpromilCDav9217 if icountryb==41&year2>1991 || sc lnetpartnershipCav9217 linetpromilCav9217 if icountryb==51&year2>1991, legend(label(1 "Mainstream party-year") label( 2 "Radical Left party-year") label( 3 "Radical Right party-year")  label( 4 "Mainstream party mean")  label( 5 "Radical Left party mean") label( 6 "Radical Right party mean") label( 7 "Soc.Dem. mean") label( 8 "Liberal mean")  label( 9 "Christ.Dem. mean") label( 10 "Conservative mean")) ytitle("Party support for partnership") xtitle("Party support for power") title("Party support for partnership and power, 1992-2018")
*corewest and fullwest:
sc lnetpartnership linetpromil if adjparfamadj4>2&adjparfamadj4<7&linetpromil!=0&lnetpartnership!=0&corewest==1&fullwestgood==1&year2>1991, msize(vsmall) mfc(midblue) mlc(midblue) || sc lnetpartnership linetpromil if adjparfamadj4==2&linetpromil!=0&lnetpartnership!=0&corewest==1&fullwestgood==1&year2>1991, msize(vsmall) mfc(emerald) mlc(emerald) || sc lnetpartnership linetpromil if adjparfamadj4==7&linetpromil!=0&lnetpartnership!=0&corewest==1&fullwestgood==1&year2>1991, msize(vsmall) mfc(cranberry) mlc(cranberry)  || sc lnetpartnershipMavcw9217 linetpromilMavcw9217 if icountryb==51&year2>1991   || sc lnetpartnershipRLavcw9217 linetpromilRLavcw9217 if icountryb==34&year2>1991 || sc lnetpartnershipRRavcw9217 linetpromilRRavcw9217 if icountryb==42&year2>1991 || sc lnetpartnershipSDavcw9217 linetpromilSDavcw9217 if icountryb==51&year2>1991  || sc lnetpartnershipLavcw9217 linetpromilLavcw9217 if icountryb==51&year2>1991   || sc lnetpartnershipCDavcw9217 linetpromilCDavcw9217 if icountryb==41&year2>1991 || sc lnetpartnershipCavcw9217 linetpromilCavcw9217 if icountryb==51&year2>1991, legend(label(1 "Mainstream party-year") label( 2 "Radical Left party-year") label( 3 "Radical Right party-year")  label( 4 "Mainstream party mean")  label( 5 "Radical Left party mean") label( 6 "Radical Right party mean") label( 7 "Soc.Dem. mean") label( 8 "Liberal mean")  label( 9 "Christ.Dem. mean") label( 10 "Conservative mean")) ytitle("Party support for partnership") xtitle("Party support for power") title("Party support for partnership and power, 1992-2018")  yline(1.22468) xline(0.280662)
*corewest with fullwest:
sc lnetpartnership linetpromil if adjparfamadj4>2&adjparfamadj4<7&linetpromil!=0&lnetpartnership!=0&corewest==1&fullwestgood==1&year2>1991, msize(vsmall) mfc(midblue) mlc(midblue) || sc lnetpartnership linetpromil if adjparfamadj4==2&linetpromil!=0&lnetpartnership!=0&corewest==1&fullwestgood==1&year2>1991, msize(vsmall) mfc(emerald) mlc(emerald) || sc lnetpartnership linetpromil if adjparfamadj4==7&linetpromil!=0&lnetpartnership!=0&corewest==1&fullwestgood==1&year2>1991, msize(vsmall) mfc(cranberry) mlc(cranberry)  || sc lnetpartnershipMavcw9217 linetpromilMavcw9217 if icountryb==51&year2>1991   || sc lnetpartnershipRLavcw9217 linetpromilRLavcw9217 if icountryb==34&year2>1991 || sc lnetpartnershipRRavcw9217 linetpromilRRavcw9217 if icountryb==42&year2>1991 || sc lnetpartnershipSDavcw9217 linetpromilSDavcw9217 if icountryb==51&year2>1991  || sc lnetpartnershipLavcw9217 linetpromilLavcw9217 if icountryb==51&year2>1991   || sc lnetpartnershipCDavcw9217 linetpromilCDavcw9217 if icountryb==41&year2>1991 || sc lnetpartnershipCavcw9217 linetpromilCavcw9217 if icountryb==51&year2>1991, legend(label(1 "Mainstream party-year") label( 2 "Radical Left party-year") label( 3 "Radical Right party-year")  label( 4 "Mainstream party mean")  label( 5 "Radical Left party mean") label( 6 "Radical Right party mean") label( 7 "Soc.Dem. mean") label( 8 "Liberal mean")  label( 9 "Christ.Dem. mean") label( 10 "Conservative mean")) ytitle("Party support for partnership") xtitle("Party support for power") title("Party support for partnership and power, 1992-2018")  yline(1.22468) xline(0.280662)
 

*Figure 4.7
use "mpdipolatepartyyear4-replic.dta"
sc lnetpartnershipMavcw5075 linetpromilMavcw5075 if icountryb==51&year2>1949&year2<1976   || sc lnetpartnershipRLavcw5075 linetpromilRLavcw5075 if icountryb==13&year2>1949&year2<1976 || sc lnetpartnershipRRavcw5075 linetpromilRRavcw5075 if icountryb==42&year2>1949&year2<1976 || sc lnetpartnershipSDavcw5075 linetpromilSDavcw5075 if icountryb==51&year2>1949&year2<1976  || sc lnetpartnershipLavcw5075 linetpromilLavcw5075 if icountryb==51&year2>1949&year2<1976   || sc lnetpartnershipCDavcw5075 linetpromilCDavcw5075 if icountryb==41&year2>1949&year2<1976 || sc lnetpartnershipCavcw5075 linetpromilCavcw5075 if icountryb==51&year2>1949&year2<1976 || sc lnetpartnershipMavcw7691 linetpromilMavcw7691 if icountryb==51&year2>1975&year2<1992   || sc lnetpartnershipRLavcw7691 linetpromilRLavcw7691 if icountryb==34&year2>1975&year2<1992 || sc lnetpartnershipRRavcw7691 linetpromilRRavcw7691 if icountryb==42&year2>1975&year2<1992 || sc lnetpartnershipSDavcw7691 linetpromilSDavcw7691 if icountryb==51&year2>1975&year2<1992  || sc lnetpartnershipLavcw7691 linetpromilLavcw7691 if icountryb==51&year2>1975&year2<1992   || sc lnetpartnershipCDavcw7691 linetpromilCDavcw7691 if icountryb==41&year2>1975&year2<1992 || sc lnetpartnershipCavcw7691 linetpromilCavcw7691 if icountryb==51&year2>1975&year2<1992|| sc lnetpartnershipMavcw9217 linetpromilMavcw9217 if icountryb==51&year2>1991   || sc lnetpartnershipRLavcw9217 linetpromilRLavcw9217 if icountryb==34&year2>1991 || sc lnetpartnershipRRavcw9217 linetpromilRRavcw9217 if icountryb==42&year2>1991 || sc lnetpartnershipSDavcw9217 linetpromilSDavcw9217 if icountryb==51&year2>1991  || sc lnetpartnershipLavcw9217 linetpromilLavcw9217 if icountryb==51&year2>1991   || sc lnetpartnershipCDavcw9217 linetpromilCDavcw9217 if icountryb==41&year2>1991 || sc lnetpartnershipCavcw9217 linetpromilCavcw9217 if icountryb==51&year2>1991, legend(cols(4) symxsize(10) label(1 "Mainstream party-year") label( 2 "Radical Left party-year") label( 3 "Radical Right party-year")  label( 4 "Mainstream party mean")  label( 5 "Radical Left party mean") label( 6 "Radical Right party mean") label( 7 "Soc.Dem. mean") label( 8 "Liberal mean")  label( 9 "Christ.Dem. mean") label( 10 "Conservative mean")) ytitle("Party support for partnership") xtitle("Party support for power")  yline(1.22468) xline(0.280662)
 

*Figure 4.8
use "mpdipolatepartyyear4-replic.dta"
tsset
xi: reg ipervote c.lnetpartnership i.adjparfamadj4 irileadjLibInt l.ipervote c.ppolityma5 c.lkofgidfma c.unempma5 i.decades i.icountryb if corewest==1, cl(icountryb)
margins, at(lnetpartnership=(-2.608041(1.1)3.299017)) saving (mt1, replace)
marginsplot, plotop(recast(line) lp(solid)) ciopts(lp(dash) recast(rline)) yt("Predicted Party's Vote Share") xt("Net Partnership in Platform") title("Effect of Partnership in Platform on Vote Share")
xi: reg ipervote c.linetpromil i.adjparfamadj4 irileadjLibInt l.ipervote c.ppolityma5 c.lkofgidfma c.unempma5 i.decades i.icountryb if corewest==1, cl(icountryb)
margins, at(linetpromil=(-2.839078(1.0)3.165222)) saving (mt2, replace)
marginsplot, plotop(recast(line) lp(solid)) ciopts(lp(dash) recast(rline)) yt("Predicted Party's Vote Share") xt("Net Pro-Military in Platform") title("Effect of Power in Platform on Vote Share")


*Figure 4.9
use "mpdipolatepartyyear4-replic.dta"
tsset
*Figure 4.9a (left-hand panel partnership)
xi: reg ipervote c.lnetpartnership##c.sstranma5 i.adjparfamadj4 irileadjLibInt l.ipervote c.ppolityma5 c.lkofgidfma c.unempma5 i.year2 i.icountryb if corewest==1, cl(cntryyear)
margins, at(lnetpartnership=(-4.286(.1)4.06) sstranma5=7.2)  at(lnetpartnership=(-4.286(.1)4.06) sstranma5=18.85)
marginsplot, recast(line)  recastci(rarea)
*Figure 4.9b (center panel power)
xi: reg ipervote c.linetpromil##c.sstranma5 i.adjparfamadj4 irileadjLibInt l.ipervote c.ppolityma5 c.lkofgidfma c.unempma5 i.year2 i.icountryb if corewest==1, cl(cntryyear)
margins, at(linetpromil=(-3.97357(.1)4.091) sstranma5=7.2) at(linetpromil=(-3.97357(.1)4.091) sstranma5=18.85)  
marginsplot, recast(line)  recastci(rarea)
*Figure 4.9c (right-hand panel partnership+power):
xi: reg ipervote c.lnetlibint##c.sstranma5 i.adjparfamadj4 irileadjLibInt l.ipervote c.ppolityma5 c.lkofgidfma c.unempma5 i.year2 i.icountryb if corewest==1, cl(cntryyear)
margins, at(lnetlibint=(-6.1672(.1)7.462995) sstranma5=7.2) at(lnetlibint=(-6.1672(.1)7.462995) sstranma5=18.85)  
marginsplot, recast(line)  recastci(rarea)


*Figure 4.10
use "TBpopcntryyearcpds2c-replic.dta"
gr twoway line kofgidfg2cwyr year2 if year2>1969, sort(year2)


*Figures 4.11:
use "TBpopcntryyearcpds2c-replic.dta"
reg KOFGIdfg raelegma5 sstranma5 polityma udima unempma realgdpgrma vturnma i.decades i.icountryb if  corewest==1,  cl(icountryb)
est store raekofun1
margins, at(raelegma5=(.420327(.03).8851753)) saving(kof1m, replace)


*Figure 4.12
use "DP_May 2021TB.dta"
gr twoway line delegatW2mean DSsumW2mean year if ioname=="UN"&year>1949, yaxis(2) ytitle("IO delegation and dispute-settlement", axis(2)) || line  poolingW2mean year if ioname=="UN"&year>1949, yaxis(1) yscale(range(.29 .36)) ytitle("IO pooling extent")


*Figure 4.13
use "DP_May 2021TB.dta"
*predictive plots and coefficient plots:
arima delegatW2mean raelegcwyr if ioname=="UN" , arima(1,1,1)
est store io1
arima poolingW2mean raelegcwyr if ioname=="UN" , arima(1,1,1)
est store io2
arima DSsumW2mean raelegcwyr if ioname=="UN" , arima(1,1,1)
est store io3
arima iopowerW2mean raelegcwyr if ioname=="UN" , arima(1,1,1)
est store io4
*Figure 4.13a:
combomarginsplot io1m io2m  , recast(line)  recastci(rarea)
*Figure 4.13b:
coefplot  io1 io2 io3 io4, xline(0) keep(*raelegcwyr) 


*Figure 4.14
use "voetenUN.dta", 
gr twoway  line agreecynonwyr year if ccode1==2&year>=1950, ytitle("Voting agreement between Western" "and non-Western countries", axis(1)) || line idealpointdistgoodnegCwest2 year if ccode1==2&year>=1950, yaxis(2) ytitle("Ideal point similarity with Western countries", axis(2))


*Figure 4.15:
use "TBpopcntryyearcpds2c-replic.dta"
reg agree raelegma sstranma5 polityma udima unempma realgdpgrma vturnma opencma5 i.decades i.icountryb if  corewest==1,  cl(icountryb)
est store raekofun3
margins, at(raelegma5=(.420327(.03).8851753)) saving(UN1m, replace)
reg agreecynon raelegma sstranma5 polityma udima unempma realgdpgrma vturnma opencma5 i.decades i.icountryb if  corewest==1,  cl(icountryb)
est store raekofun4
margins, at(raelegma5=(.420327(.03).8851753)) saving(UN2m, replace)
reg idealpointdistgoodneg raelegma sstranma5 polityma udima unempma realgdpgrma vturnma opencma5 i.decades i.icountryb if  corewest==1,  cl(icountryb)
est store raekofun5
margins, at(raelegma5=(.420327(.03).8851753)) saving(UN3m, replace)
reg idealpointdistgoodnegcynon raelegma sstranma5 polityma udima unempma realgdpgrma vturnma opencma5 i.decades i.icountryb if  corewest==1,  cl(icountryb) 
est store raekofun6
margins, at(raelegma5=(.420327(.03).8851753)) saving(UN4m, replace) level(90)
*Figure 4.15a:
combomarginsplot UN2m, recast(line)  recastci(rarea) ytitle(Predicted voting agreement with Western countries)
*Figure 4.15b:
combomarginsplot UN4m, recast(line)  recastci(rarea) ytitle(Predicted ideal-point similarity with Western countries)
* extras:
coefplot raekofun3 raekofun4 raekofun5 raekofun6, xline(0) keep(raelegma5) 



*************
*************

* Appendix A Tables *

*************
*************


* Appendix A Table 1:
use "TBpopcntryyearcpds2c-replic.dta"
sum lkofpoleconDJg lwdiexpmil2 stdpartpow4b  iipervoteM3cy iipervoteRR3cy iipervoteRL3cy iipervoteRRRL3cy ipervoteMminRRRL3cy3 rae_leg lnetpartnership linetpromil lnetlibintl lnetpartnervotewghtM3cyma  ilnetpromilvotewghtM3cyma lnetlibintlvoteweightM3cyma sstranma5 geoslacknew6  devnetpartvotelkofpolecg2 devnetpromilvotelwdimilex22 kofpogidfma kofgidfgma5 govright1ma polityma ipervotema vturnma udima unempma realgdpgrma irile effparlegma5 decades icountryb if corewest==1&fullwestall==1

* Appendix A Table 2:
use "mpdipolatepartyyear4-replic.dta"
sum lnetpartnership linetpromil lnetlibint lnetpartnervoteweight linetpromilvoteweight lnetlibintvoteweight sstranma5 geoslacknew6 govright1ma ppolityma5 ipervotema vturnma udima unempma realgdpgrma irileadjLibInt decades icountryb if corewest==1&fullwest==1


*************
*************

* Appendix B Tables *

*************
*************

* Appendix B Table 1 (for Figure 3.2 and 3.8):
use "TBpopcntryyearcpds2c-replic.dta"
* Columns 1-3 (baseline)
reg lkofpoleconDJg c.sstranma5 c.geoslacknew6 polityma opencma5 ipervotema vturnma udima unempma realgdpgrma i.decades i.icountryb if corewest==1,  cl(icountryb)
reg  lwdiexpmil2 c.sstranma5 c.geoslacknew6 polityma opencma5 ipervotema vturnma udima unempma realgdpgrma i.decades i.icountryb if corewest==1,  cl(icountryb)
reg stdpartpow4b c.sstranma5 c.geoslacknew6 polityma opencma5 ipervotema vturnma udima unempma realgdpgrma i.decades i.icountryb if corewest==1,  cl(icountryb)
* Columns 4-6 (seemingly-unrelated regression version):
xi: sureg (stdpartpow4b c.sstranma5 c.geoslacknew6 polityma opencma5 ipervotema vturnma udima unempma realgdpgrma i.decades i.icountryb if corewest==1&year2>1949) (flkofpoleconDJg c.sstranma5 c.geoslacknew6 polityma opencma5 ipervotema vturnma udima unempma realgdpgrma i.decades i.icountryb if corewest==1&year2>1949)  ( flwdiexpmil2 c.sstranma5 c.geoslacknew6 polityma opencma5 ipervotema vturnma udima unempma realgdpgrma i.decades i.icountryb if corewest==1&year2>1949), 
suregr, cluster(icountryb)
 
 
* Appendix B Table 2 (for Figure 3.3):
use "mpdipolatepartyyear4-replic.dta"
reg lnetpartnership c.sstranma5 i.adjparfamadj4 c.ppolityma5 c.opencma5 c.unempma5 ipervotema5 irileadjLibInt i.decades i.icountryb if corewest==1, cl(icountryb)
reg linetpromil c.sstranma5 i.adjparfamadj4 c.ppolityma5 c.opencma5 c.unempma5 ipervotema5 irileadjLibInt i.decades i.icountryb if corewest==1, cl(icountryb)
reg lnetlibint c.sstranma5 i.adjparfamadj4 c.ppolityma5 c.opencma5 c.unempma5 ipervotema5 irileadjLibInt i.decades i.icountryb if corewest==1, cl(icountryb)
reg lnetpartnership c.sstranma5##i.adjparfamadj4 c.ppolityma5 c.opencma5 c.unempma5 ipervotema5 irileadjLibInt i.decades i.icountryb if corewest==1, cl(icountryb)
reg linetpromil c.sstranma5##i.adjparfamadj4 c.ppolityma5 c.opencma5 c.unempma5 ipervotema5 irileadjLibInt i.decades i.icountryb if corewest==1, cl(icountryb)
reg lnetlibint c.sstranma5##i.adjparfamadj4 c.ppolityma5 c.opencma5 c.unempma5 ipervotema5 irileadjLibInt i.decades i.icountryb if corewest==1, cl(icountryb)


*Appendix B Table 3 (for Figure 3.4 and 3.10):
use "mpdipolatepartyyear4-replic.dta"
reg lnetpartnervoteweight c.sstranma5  i.adjparfamadj4 c.ppolityma5 c.lkofgidfma5 c.unempma5 ipervotema5 irileadjLibInt i.decades i.icountryb if corewest==1, cl(icountryb)
reg linetpromilvoteweight c.sstranma5  i.adjparfamadj4 c.ppolityma5 c.lwdiexpmil2ma5 c.unempma5 ipervotema5 irileadjLibInt i.decades i.icountryb if corewest==1, cl(icountryb)
reg lnetlibintvoteweight c.sstranma5  i.adjparfamadj4 c.ppolityma5 c.lkofgidfma5 c.lwdiexpmil2ma5 c.unempma5 ipervotema5 irileadjLibInt i.decades i.icountryb if corewest==1, cl(icountryb)
reg lnetpartnervoteweight c.geoslacknew6  i.adjparfamadj4 c.ppolityma5 c.lkofgidfma5 c.unempma5 ipervotema5 irileadjLibInt i.decades i.icountryb if corewest==1, cl(icountryb)
reg linetpromilvoteweight c.geoslacknew6  i.adjparfamadj4 c.ppolityma5 c.lwdiexpmil2ma5 c.unempma5 ipervotema5 irileadjLibInt i.decades i.icountryb if corewest==1, cl(icountryb)
reg lnetlibintvoteweight c.geoslacknew6  i.adjparfamadj4 c.ppolityma5 c.lkofgidfma5 c.lwdiexpmil2ma5 c.unempma5 ipervotema5 irileadjLibInt i.decades i.icountryb if corewest==1, cl(icountryb)


*Appendix B Table 4 (for Figure 3.9):
use "mpdipolatepartyyear4-replic.dta"
reg lnetpartnership c.geoslacknew6 i.adjparfamadj4 c.ppolityma5 c.opencma5 c.unempma5 ipervotema5 irileadjLibInt i.decades i.icountryb if corewest==1, cl(icountryb)
reg linetpromil c.geoslacknew6  i.adjparfamadj4 c.ppolityma5 c.opencma5 c.unempma5 ipervotema5 irileadjLibInt i.decades i.icountryb if corewest==1, cl(icountryb)
reg lnetlibint c.geoslacknew6 i.adjparfamadj4 c.ppolityma5 c.opencma5 c.unempma5 ipervotema5 irileadjLibInt i.decades i.icountryb if corewest==1, cl(icountryb)
reg lnetpartnership c.geoslacknew6##i.adjparfamadj4 c.ppolityma5 c.opencma5 c.unempma5 ipervotema5 irileadjLibInt i.decades i.icountryb if corewest==1, cl(icountryb)
reg linetpromil c.geoslacknew6##i.adjparfamadj4 c.ppolityma5 c.opencma5 c.unempma5 ipervotema5 irileadjLibInt i.decades i.icountryb if corewest==1, cl(icountryb)
reg lnetlibint c.geoslacknew6##i.adjparfamadj4 c.ppolityma5 c.opencma5 c.unempma5 ipervotema5 irileadjLibInt i.decades i.icountryb if corewest==1, cl(icountryb)


*Appendix B Table 5 (for Figure 3.11)
use "TBpopcntryyearcpds2c-replic.dta"
reg f.devnetpartvotelkofpolecg2 kofgidfg2ma irilema polityma5 govright1ma ipervotema vturnma udima unempma realgdpgrma i.decades if corewest==1, cl(icountryb)
reg f.devnetpartvotelkofpolecg2 kofgidfg2ma irilema polityma5 govright1ma ipervotema vturnma udima unempma realgdpgrma i.decades i.icountryb if corewest==1, cl(icountryb)
reg f.devnetpartvotelkofpolecg2 kofgedfgma5 irilema polityma5 govright1ma ipervotema vturnma udima unempma realgdpgrma i.decades if corewest==1, cl(icountryb)
reg f.devnetpartvotelkofpolecg2 kofgedfgma5 irilema polityma5 govright1ma ipervotema vturnma udima unempma realgdpgrma i.decades i.icountryb if corewest==1, cl(icountryb)
reg f.devnetpartvotelkofpolecg2 kofpogidfma irilema polityma5 govright1ma ipervotema vturnma udima unempma realgdpgrma i.decades if corewest==1, cl(icountryb)
reg f.devnetpartvotelkofpolecg2 kofpogidfma irilema polityma5 govright1ma ipervotema vturnma udima unempma realgdpgrma i.decades i.icountryb if corewest==1, cl(icountryb)


*Appendix B Table 6a-6e (for Figures 4.3 and 4.4)
use "TBpopcntryyearcpds2c-replic.dta"
*AppBTable 6a
xi: sureg (flkofpoleconDJg  iipervoteM3cy l4.kofgidfgma5 govright1ma polityma ipervotema vturnma udima unempma realgdpgrma i.decades i.icountryb if corewest==1)  (flwdiexpmil2  iipervoteM3cy l4.kofgidfgma5 govright1ma polityma ipervotema vturnma udima unempma realgdpgrma i.decades i.icountryb if corewest==1) (stdpartpow4b  iipervoteM3cy l4.kofgidfgma5 govright1ma polityma ipervotema vturnma udima unempma realgdpgrma i.decades i.icountryb if corewest==1), 
 suregr, cluster(icountryb)
est store m2a2

*AppBTable 6b:
xi: sureg (flkofpoleconDJg  iipervoteRR3cy l4.kofgidfgma5 govright1ma polityma ipervotema vturnma udima unempma realgdpgrma i.decades i.icountryb if corewest==1) (flwdiexpmil2  iipervoteRR3cy l4.kofgidfgma5 govright1ma polityma ipervotema vturnma udima unempma realgdpgrma i.decades i.icountryb if corewest==1) (stdpartpow4b  iipervoteRR3cy l4.kofgidfgma5 govright1ma polityma ipervotema vturnma udima unempma realgdpgrma i.decades i.icountryb if corewest==1), 
 suregr, cluster(icountryb)
est store m2b2

*AppBTable 6c:
xi: sureg  (flkofpoleconDJg  iipervoteRL3cy l4.kofgidfgma5 govright1ma polityma ipervotema vturnma udima unempma realgdpgrma i.decades i.icountryb if corewest==1) (flwdiexpmil2  iipervoteRL3cy l4.kofgidfgma5 govright1ma polityma ipervotema vturnma udima unempma realgdpgrma i.decades i.icountryb if corewest==1)  (stdpartpow4b  iipervoteRL3cy l4.kofgidfgma5 govright1ma polityma ipervotema vturnma udima unempma realgdpgrma i.decades i.icountryb if corewest==1), 
 suregr, cluster(icountryb)
est store m2c2

*AppBTable 6d:
xi: sureg (flkofpoleconDJg  iipervoteRRRL3cy l4.kofgidfgma5 govright1ma polityma ipervotema vturnma udima unempma realgdpgrma i.decades i.icountryb if corewest==1) (flwdiexpmil2  iipervoteRRRL3cy l4.kofgidfgma5 govright1ma polityma ipervotema vturnma udima unempma realgdpgrma i.decades i.icountryb if corewest==1) (stdpartpow4b  iipervoteRRRL3cy l4.kofgidfgma5 govright1ma polityma ipervotema vturnma udima unempma realgdpgrma i.decades i.icountryb if corewest==1), 
 suregr, cluster(icountryb)
est store m2cc2

*AppBTable 6e:
xi: sureg (flkofpoleconDJg  ipervoteMminRRRL3cy3 l4.kofgidfgma5 govright1ma polityma ipervotema vturnma udima unempma realgdpgrma i.decades i.icountryb if corewest==1) (flwdiexpmil2  ipervoteMminRRRL3cy3 l4.kofgidfgma5 govright1ma polityma ipervotema vturnma udima unempma realgdpgrma i.decades i.icountryb if corewest==1) (stdpartpow4b  ipervoteMminRRRL3cy3 l4.kofgidfgma5 govright1ma polityma ipervotema vturnma udima unempma realgdpgrma i.decades i.icountryb if corewest==1), 
 suregr, cluster(icountryb)
est store m2d2


*Appendix B Table 7 (for Figure 4.8):
use "mpdipolatepartyyear4-replic.dta"
tsset
reg ipervote c.lnetpartnership i.adjparfamadj4 irileadjLibInt l.ipervote c.ppolityma5 c.lkofgidfma c.unempma5 i.decades i.icountryb if corewest==1, cl(icountryb) 
reg ipervote c.linetpromil i.adjparfamadj4 irileadjLibInt l.ipervote c.ppolityma5 c.lkofgidfma c.unempma5 i.decades i.icountryb if corewest==1, cl(icountryb)
reg ipervote c.lnetlibint i.adjparfamadj4 irileadjLibInt l.ipervote c.ppolityma5 c.lkofgidfma c.unempma5 i.decades i.icountryb if corewest==1, cl(icountryb)
reg ipervote c.lnetpartnership##coldwarB i.adjparfamadj4 irileadjLibInt l.ipervote c.ppolityma5 c.lkofgidfma c.unempma5 i.decades i.icountryb if corewest==1, cl(icountryb)
reg ipervote c.linetpromil##coldwarB i.adjparfamadj4 irileadjLibInt l.ipervote c.ppolityma5 c.lkofgidfma c.unempma5 i.decades i.icountryb if corewest==1, cl(icountryb)
reg ipervote c.lnetlibint##coldwarB i.adjparfamadj4 irileadjLibInt l.ipervote c.ppolityma5 c.lkofgidfma c.unempma5 i.decades i.icountryb if corewest==1, cl(icountryb)


*Appendix B Table 8 (for Figure 4.9):
use "mpdipolatepartyyear4-replic.dta"
tsset
reg ipervote c.lnetpartnership##c.sstranma5 i.adjparfamadj4 irileadjLibInt l.ipervote c.ppolityma5 c.lkofgidfma c.unempma5 i.year2 i.icountryb if corewest==1, cl(cntryyear)
reg ipervote c.linetpromil##c.sstranma5 i.adjparfamadj4 irileadjLibInt l.ipervote c.ppolityma5 c.lkofgidfma c.unempma5 i.year2 i.icountryb if corewest==1, cl(cntryyear)
reg ipervote c.lnetlibint##c.sstranma5 i.adjparfamadj4 irileadjLibInt l.ipervote c.ppolityma5 c.lkofgidfma c.unempma5 i.year2 i.icountryb if corewest==1, cl(cntryyear)
reg ipervote c.lnetpartnership##c.geoslacknew6 i.adjparfamadj4 irileadjLibInt l.ipervote c.ppolityma5 c.lkofgidfma c.unempma5 i.year2 i.icountryb if corewest==1, cl(cntryyear)
reg ipervote c.linetpromil##c.geoslacknew6 i.adjparfamadj4 irileadjLibInt l.ipervote c.ppolityma5 c.lkofgidfma c.unempma5 i.year2 i.icountryb if corewest==1, cl(cntryyear)
reg ipervote c.lnetlibint##c.geoslacknew6 i.adjparfamadj4 irileadjLibInt l.ipervote c.ppolityma5 c.lkofgidfma c.unempma5 i.year2 i.icountryb if corewest==1, cl(cntryyear)


*Appendix B Table 9 (for Figure 4.11 and 4.15):
use "TBpopcntryyearcpds2c-replic.dta"
reg KOFGIdfg raelegma sstranma5 polityma udima unempma realgdpgrma vturnma i.decades i.icountryb if  corewest==1,  cl(icountryb)
reg KOFPoGIdf raelegma sstranma5 polityma udima unempma realgdpgrma vturnma i.decades i.icountryb if  corewest==1,  cl(icountryb)
reg agree raelegma sstranma5 polityma udima unempma realgdpgrma vturnma opencma5 i.decades i.icountryb if  corewest==1,  cl(icountryb)
reg agreecynon raelegma sstranma5 polityma udima unempma realgdpgrma vturnma opencma5 i.decades i.icountryb if  corewest==1,  cl(icountryb)
reg idealpointdistgoodneg raelegma sstranma5 polityma udima unempma realgdpgrma vturnma opencma5 i.decades i.icountryb if  corewest==1,  cl(icountryb)
reg idealpointdistgoodnegcynon raelegma sstranma5 polityma udima unempma realgdpgrma vturnma opencma5 i.decades i.icountryb if  corewest==1,  cl(icountryb)


*Appendix B Table 10a-10c (for Figure 4.13):
use "DP_May 2021TB.dta"
*Table 10a:
arima delegatW2mean raelegcwyr if ioname=="UN" , arima(1,1,1)
arima poolingW2mean raelegcwyr if ioname=="UN" , arima(1,1,1)
arima DSsumW2mean raelegcwyr if ioname=="UN" , arima(1,1,1)
arima iopowerW2mean raelegcwyr if ioname=="UN" , arima(1,1,1)

*Appendix B Table 10b:
arima delegatNW2mean raelegcwyr if ioname=="UPU" , arima(1,1,1)
arima poolingNW2mean raelegcwyr if ioname=="UPU" , arima(1,1,1)
arima DSsumNW2mean raelegcwyr if ioname=="UPU" , arima(1,1,1)
arima iopowerNW2mean raelegcwyr if ioname=="UPU" , arima(1,1,1)

*Appendix B Table 10c:
arima delegatW3bchmean raelegcwyr  if ioname=="UN" , arima(1,1,0)
arima delegatW3bchmean raelegcwyr ipervoteMminRRRL33cwyr if ioname=="UN" , arima(1,1,0)
arima delegatW3bchmean effparlegcwyr  if ioname=="UN" , arima(1,1,0)
arima delegatW3bchmean effparlegcwyr ipervoteMminRRRL33cwyr if ioname=="UN" , arima(1,1,0)



*************
*************

* Appendix D Tables *

*************
*************

* Appendix D (categorical specifications of government policies towards partnership and power): (1-4, where 4==Liberal Internationalism (partnership and power both above sample median)
use "TBpopcntryyearcpds2c-replic.dta"
* Appendix D Table 1:
logit powparB1 c.sstranma5 c.geoslacknew6 polityma opencma5 ipervotema vturnma udima unempma realgdpgrma i.decades i.icountryb, vce(rob)
melogit powparB1 c.sstranma5 c.geoslacknew6 polityma opencma5 ipervotema vturnma udima unempma realgdpgrma i.decades if corewest==1 || icountryb:   
mlogit PowParcatcw c.sstranma5 c.geoslacknew6 polityma opencma5 ipervotema vturnma udima unempma realgdpgrma i.decades i.icountryb  

*Appendix D Table 2:
use "TBpopcntryyearcpds2c-replic.dta"
logit powparB1 ipervoteMminRRRL3cy3 polityma opencma5 ipervotema vturnma udima unempma realgdpgrma i.decades i.icountryb, vce(rob)
melogit powparB1 ipervoteMminRRRL3cy3 polityma opencma5 ipervotema vturnma udima unempma realgdpgrma i.decades if corewest==1 || icountryb: 
mlogit PowParcatcw ipervoteMminRRRL3cy3 polityma opencma5 ipervotema vturnma udima unempma realgdpgrma i.decades , baseoutcome(4)  




*************
*************

* Appendix E Table and Figures *

*************
*************

* Appendix E Table 1
use "TBpopcntryyearcpds2c-replic.dta"
reg iipervoteRR3cy devnetpartvotelkofpolecgrae2 devnetpromilvotelwdimilex2rae22 polityma opencma5 ipervotema vturnma udima unempma realgdpgrma i.decades i.icountryb if  corewest==1,  cl(icountryb)
est store s3m1cA
reg iipervoteRL3cy devnetpartvotelkofpolecgrae2 devnetpromilvotelwdimilex2rae22 polityma opencma5 ipervotema vturnma udima unempma realgdpgrma i.decades i.icountryb if corewest==1,  cl(icountryb)
est store s3m2cA
reg iipervoteRRRL3cy devnetpartvotelkofpolecgrae2 devnetpromilvotelwdimilex2rae22 polityma opencma5 ipervotema vturnma udima unempma realgdpgrma i.decades i.icountryb if corewest==1,  cl(icountryb) 
est store s3m3cA
reg iipervoteM3cy devnetpartvotelkofpolecgrae2 devnetpromilvotelwdimilex2rae22 polityma opencma5 ipervotema vturnma udima unempma realgdpgrma i.decades i.icountryb if corewest==1,  cl(icountryb) 
est store s3m4cA
reg ipervoteMminRRRL3cy3 devnetpartvotelkofpolecgrae2 devnetpromilvotelwdimilex2rae22 polityma opencma5 ipervotema vturnma udima unempma realgdpgrma i.decades i.icountryb if corewest==1,  cl(icountryb) 
est store s3m5cA
reg raeleg100 devnetpartvotelkofpolecgrae2 devnetpromilvotelwdimilex2rae22 polityma opencma5 ipervotema vturnma udima unempma realgdpgrma i.decades i.icountryb if corewest==1,  cl(icountryb) 
est store s3m6cA

* Appendix E Figure 1:
use "TBpopcntryyearcpds2c-replic.dta"
* AppE Figure 1a:
coefplot s3m1cA s3m2cA s3m3cA s3m4cA s3m5cA s3m6cA, keep(devnetpartvotelkofpolecgrae2) xline(0)  ylabel( .65 "...on Radical Right vote share" .79 "...on Radical Left vote share" .93 "...on All Radical vote share" 1.07 "...on Mainstream vote share" 1.21 "...on Net Mainstream vote share" 1.35 "...on Party-system fragmentation") title("Effect of Voter-Policy Gap" "with respect to PARTNERSHIP...") xtitle("Effect of Voter-Policy Gap on various vote shares") legend(off)
* AppE Figure 1b:
coefplot s3m1cA s3m2cA s3m3cA s3m4cA s3m5cA, keep(devnetpromilvotelwdimilex22) xline(0)  ylabel( .667 "...on Radical Right vote share" .83 "...on Radical Left vote share" 1 "...on All Radical vote share" 1.17 "...on Mainstream vote share" 1.335 "...on Net Mainstream vote share") title("Effect of Voter-Policy Gap" "with respect to POWER...") xtitle("Effect of Voter-Policy Gap on various vote shares") legend(off)

* Appendix E Figure 2:
use "TBpopcntryyearcpds2c-replic.dta"
est restore s3m1cA
margins, at(devnetpartvotelkofpolecgrae2=(0(.2)2.53)) saving (mbdev1b, replace)
est restore s3m2cA
margins, at(devnetpartvotelkofpolecgrae2=(0(.2)2.53)) saving (mbdev2b, replace)
est restore s3m3cA
margins, at(devnetpartvotelkofpolecgrae2=(0(.2)2.53)) saving (mbdev3b, replace)
combomarginsplot  mbdev2b mbdev1b mbdev3b ,  plotop(recast(line) lp(solid)) ciopts(lp(dash) recast(rarea)) yt("Predicted Vote Share of Party Family") xt("Estimated Gap on Partnership") title("Predicted Radical Party Vote Share in Country-Year") legend(off)




*************
*************

* Appendix F Figures *

*************
*************

* Appendix F Figure 1
use "TBpopcntryyearcpds2c-replic.dta"
* AppF Figure 1a:
gr twoway line lkofpoleconDJg year2 if year2>1969&year2<2019&icountryb==42, ytitle("KOF-based index of globalization policies") ||  line lkofpoleconDJg year2 if year2>1969&year2<2019&icountryb==31 ||  line lkofpoleconDJg year2 if year2>1969&year2<2019&icountryb==41 ||  line lkofpoleconDJg year2 if year2>1969&year2<2019&icountryb==53 ||  line lkofpoleconDJg year2 if year2>1969&year2<2019&icountryb==32 ||  line lkofpoleconDJg year2 if year2>1969&year2<2019&icountryb==33 ||  line lkofpoleconDJg year2 if year2>1969&year2<2019&icountryb==51, legend(label(1 "Austria") label(2 "France") label(3 "Germany") label(4 "Ireland") label(5 "Italy") label(6 "Spain") label(7 "United Kingdom"))
* AppF Figure 1b:
gr twoway line wdi_expmil2 year2 if year2>1969&year2<2019&icountryb==42, ytitle("Military expenditures (% GDP)") ||  line wdi_expmil2 year2 if year2>1969&year2<2019&icountryb==31 ||  line wdi_expmil2 year2 if year2>1969&year2<2019&icountryb==41 ||  line wdi_expmil2 year2 if year2>1969&year2<2019&icountryb==53 ||  line wdi_expmil2 year2 if year2>1969&year2<2019&icountryb==32 ||  line wdi_expmil2 year2 if year2>1969&year2<2019&icountryb==33 ||  line wdi_expmil2 year2 if year2>1969&year2<2019&icountryb==51,  legend(label(1 "Austria") label(2 "France") label(3 "Germany") label(4 "Ireland") label(5 "Italy") label(6 "Spain") label(7 "United Kingdom"))

* Appendix F Figure 2
use "voetenUNTB.dta"
* AppF Figure 2a:
gr twoway  line agreeUSnonwyr year if ccode1==2&year>=1950, ytitle("Agreement with US",  axis(1)) || line idealpointnegUSnonwyr year if ccode1==2&year>=1950, yaxis(2)  ytitle("Ideal-point similarity with US", axis(2))
* AppF Figure 2b:
gr twoway  line agreeEUnonwyr year if year>=1950, ytitle("Agreement with EU-15",  axis(1)) || line idealpointnegEUnonwyr year if year>=1950, yaxis(2) ytitle("Ideal-point similarity with EU-15",  axis(2))
* AppF Figure 3c:
gr twoway  line agreeJnonwyr year if year>=1950, ytitle("Agreement with Japan",  axis(1)) || line idealpointnegJnonwyr year if year>=1950, yaxis(2) ytitle( "Ideal-point similarity with Japan",  axis(2))






